import qr from 'qr-image'

export const qrUri = (value, opts = {}) => {
  const img = qr.imageSync(value, {
    type: 'png',
    size: opts.size || 7,
    margin: opts.margin || 2
  })
  const uri = 'data:image/png;base64,' + img.toString('base64')

  return uri
}

export default qrUri
